package org.example.homeWork;

import java.util.Scanner;

/**
 * @AUTHOR 尹书岿
 * @DATE 2024/12/9 17:11
 * @DESCRIBE
 */
public class home27 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] chars = sc.nextLine().toCharArray();
        int[] num = new int[10];
        for(int i = 0; i < chars.length ; i++){
            if (num[chars[i] - '0'] == 0){
                num[chars[i] - '0'] =1;
            }
        }
        String arr= "";
        for (int i = 9 ;i >= 0 ; i--){
            if(num[i] == 1){
                arr += i;
            }
        }

        System.out.print("int[] arr = new int[]{");
        for (int i = 0 ; i < arr.length() ; i++) {
            if(i == arr.length() -1){
                System.out.println(arr.charAt(i)+"};");
                break;
            }
            System.out.print(arr.charAt(i) + ",");
        }

        System.out.print("int[] index = new int[]{");
        for (int i = 0; i <11; i++){
            if(i == 10){
                System.out.println(arr.indexOf(chars[i])+"};");
                break;
            }
            System.out.print(arr.indexOf(chars[i]) + ",");
        }

    }
}

